When xc_linux_build fails without a meaninful errno, force errno to EINVAL
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Thu, 16 Feb 2006 16:19:38 +0000 (16:19 +0000)
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Thu, 16 Feb 2006 16:19:38 +0000 (16:19 +0000)
avoid message "Error creating domain: (0, 'Error')" in the case
domU version is too old or too new.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
tools/python/xen/lowlevel/xc/xc.c

index d7cc20a2740581b95967bed820a69f5eac8b401c..1a3431e2b1573da0c0ec4436f5b6d2a0362a54b3 100644 (file)
@@ -347,9 +347,11 @@ static PyObject *pyxc_linux_build(XcObject *self,
     if ( xc_linux_build(self->xc_handle, dom, image,
                         ramdisk, cmdline, flags,
                         store_evtchn, &store_mfn, 
-                       console_evtchn, &console_mfn) != 0 )
+                       console_evtchn, &console_mfn) != 0 ) {
+        if (!errno)
+             errno = EINVAL;
         return PyErr_SetFromErrno(xc_error);
-    
+    }
     return Py_BuildValue("{s:i,s:i}", 
                         "store_mfn", store_mfn,
                         "console_mfn", console_mfn);